﻿// <copyright file="TTableStorageInfo.cs" company="N/A">
//     Copyright (c) Nicholas Barrett and Benjamin Kasten.  All rights reserved.
//
//     This program is free software; you can redistribute it and/or modify it
//     under the terms of the GNU General Public License as published by the
//     Free Software Foundation; either version 2 of the License, or (at your
//     option) any later version.
//
//     This program is distributed in the hope that it will be useful, but
//     WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
//     Public License for more details.
//
//     You should have received a copy of the GNU General Public License along
//     with this program; if not, write to the Free Software Foundation, 
//     Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// </copyright>

namespace BetterAzureTableStorage
{
    using System;
    using System.Collections.Generic;
    using System.Reflection;

    /// <summary>
    /// Class for storing information to transmit between the context and the engine
    /// </summary>
    public class TTableStorageInfo
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TTableStorageInfo"/> class.
        /// </summary>
        /// <param name="classType">Type of the class.</param>
        /// <param name="tableName">Name of the table.</param>
        public TTableStorageInfo(Type classType, string tableName, int? conditionalValue = null, List<TTablePropertyInfo> propertyList = null)
        {
            this.ClassType = classType;
            this.TableName = tableName;
            this.PropertyList = propertyList;
            this.ConditionalValue = conditionalValue;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TTableStorageInfo"/> class.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        public TTableStorageInfo(string tableName)
        {
            this.TableName = tableName;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TTableStorageInfo"/> class.
        /// </summary>
        public TTableStorageInfo()
        {
        }

        /// <summary>
        /// Gets or sets the type of the class.
        /// </summary>
        /// <value>The type of the class.</value>
        public Type ClassType { get; set; }
        
        /// <summary>
        /// Gets or sets the name of the table.
        /// </summary>
        /// <value>The name of the table.</value>
        public string TableName { get; set; }
        
        /// <summary>
        /// Gets or sets the property list and field names.
        /// </summary>
        /// <value>The property and field name list</value>
        public List<TTablePropertyInfo> PropertyList { get; set; }
        
        /// <summary>
        /// Gets or sets the conditional value.
        /// </summary>
        /// <value>The conditional value.</value>
        public int? ConditionalValue { get; set; }
    }
}